Optimal. Leaf size=80 \[ \frac{B+i A}{4 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac{x (A-i B)}{4 a^2}+\frac{-B+i A}{4 d (a+i a \tan (c+d x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0615542, antiderivative size = 80, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {3526, 3479, 8} \[ \frac{B+i A}{4 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac{x (A-i B)}{4 a^2}+\frac{-B+i A}{4 d (a+i a \tan (c+d x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3526
Rule 3479
Rule 8
Rubi steps
\begin{align*} \int \frac{A+B \tan (c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=\frac{i A-B}{4 d (a+i a \tan (c+d x))^2}+\frac{(A-i B) \int \frac{1}{a+i a \tan (c+d x)} \, dx}{2 a}\\ &=\frac{i A-B}{4 d (a+i a \tan (c+d x))^2}+\frac{i A+B}{4 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac{(A-i B) \int 1 \, dx}{4 a^2}\\ &=\frac{(A-i B) x}{4 a^2}+\frac{i A-B}{4 d (a+i a \tan (c+d x))^2}+\frac{i A+B}{4 d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end{align*}
Mathematica [A] time = 0.520707, size = 94, normalized size = 1.18 \[ -\frac{\sec ^2(c+d x) ((4 i A d x+A+4 B d x+i B) \sin (2 (c+d x))+(A (4 d x+i)+B (-1-4 i d x)) \cos (2 (c+d x))+4 i A)}{16 a^2 d (\tan (c+d x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.028, size = 162, normalized size = 2. \begin{align*}{\frac{A}{4\,{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{{\frac{i}{4}}B}{{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{{\frac{i}{4}}A}{{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}+{\frac{B}{4\,{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{{\frac{i}{8}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) A}{{a}^{2}d}}-{\frac{\ln \left ( \tan \left ( dx+c \right ) -i \right ) B}{8\,{a}^{2}d}}+{\frac{B\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{8\,{a}^{2}d}}+{\frac{{\frac{i}{8}}A\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{{a}^{2}d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.36364, size = 150, normalized size = 1.88 \begin{align*} \frac{{\left (4 \,{\left (A - i \, B\right )} d x e^{\left (4 i \, d x + 4 i \, c\right )} + 4 i \, A e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A - B\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{16 \, a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.80745, size = 163, normalized size = 2.04 \begin{align*} \begin{cases} \frac{\left (16 i A a^{2} d e^{4 i c} e^{- 2 i d x} + \left (4 i A a^{2} d e^{2 i c} - 4 B a^{2} d e^{2 i c}\right ) e^{- 4 i d x}\right ) e^{- 6 i c}}{64 a^{4} d^{2}} & \text{for}\: 64 a^{4} d^{2} e^{6 i c} \neq 0 \\x \left (- \frac{A - i B}{4 a^{2}} + \frac{\left (A e^{4 i c} + 2 A e^{2 i c} + A - i B e^{4 i c} + i B\right ) e^{- 4 i c}}{4 a^{2}}\right ) & \text{otherwise} \end{cases} + \frac{x \left (A - i B\right )}{4 a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.34553, size = 149, normalized size = 1.86 \begin{align*} -\frac{\frac{2 \,{\left (-i \, A - B\right )} \log \left (\tan \left (d x + c\right ) + i\right )}{a^{2}} - \frac{2 \,{\left (-i \, A - B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{a^{2}} - \frac{3 i \, A \tan \left (d x + c\right )^{2} + 3 \, B \tan \left (d x + c\right )^{2} + 10 \, A \tan \left (d x + c\right ) - 10 i \, B \tan \left (d x + c\right ) - 11 i \, A - 3 \, B}{a^{2}{\left (\tan \left (d x + c\right ) - i\right )}^{2}}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]